package ren.yugong.fileutil.template;

import ren.yugong.fileutil.TxtTemplate;
import ren.yugong.fileutil.TxtTemplateColumn;

import java.text.SimpleDateFormat;
import java.util.Date;

@TxtTemplate(columnSplit = "\\|")
public class Demo1Template {

    @TxtTemplateColumn(order = 1)
    private int id;

    @TxtTemplateColumn(order = 2)
    private String name;

    @TxtTemplateColumn(order = 3, format = "yyyy-MM-dd")
    private Date birthday;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return id + "|" + name +"|"+sdf.format(birthday);
    }
}
